program Project1;

{$APPTYPE CONSOLE}

uses
SysUtils;
type
  pelement = ^element;
  element = record
  value: integer;
  next: pelement;
end;
procedure AddToBegin (var head: pelement; num: integer);
var
  tmp: pelement;
begin
  tmp:= head;
  new(head);
  head^.value:= num;
  head^.next:= tmp;
end;
var
  i, n, num, tmp: integer;
  head, current: pelement;
  fin, fout: textfile;
begin
  assignfile(fin, 'run.txt');
  assignfile(fout, 'unrun.txt');
  reset(fin);
  rewrite(fout);
  readln(fin, n);
  for I := 1 to n do
  begin
    readln(fin, num);
    AddToBegin (head, num);
  end;
  current:= head;
  for i := 1 to n do
  begin
    if current^.next<>nil then
    begin
    tmp:=current^.value;
    current^.value:= current^.next^.value;
    current^.next^.value:= tmp;
    current:=current^.next;
    end;
  end;
  current:= head;
  while (current<>nil) do
  begin
    writeln (fout, current^.value);
    current:= current^.next;
  end;
  closefile(fin);
  closefile(fout);
end.
